<?php
  require_once("comum.inc.php");
  
  // consultar aqui e montar objeto aqui
  $hoje = new DateTime();
  $dia = new DateTime();
  $dia->sub(new DateInterval("P7D"));
    
  $resposta = new stdClass();
  
  while ($dia < $hoje) {
    $resposta->rotulos[] = $dia->format("d/m/Y") . "<br>" . $diasDaSemana[intval($dia->format("N"))];
    $dia->add(new DateInterval("P1D"));
  }

  for ($i = 0; $i < 7; $i++) {
    $resposta->emol[] = rand(0,9999999) + rand(0,99) / 100;  
  }
  
  for ($i = 0; $i < 7; $i++) {
    $resposta->tsnr[] = rand(0,9999999) + rand(0,99) / 100;  
  }
  
  for ($i = 0; $i < 7; $i++) {
    $resposta->ferc[] = rand(0,9999999) + rand(0,99) / 100;  
  }

  // converter para JSON aqui
  header("Content-type: text/javascript; charset=utf-8");
  echo(json_encode($resposta));
?>
